import matplotlib.pyplot as plt
from settings import rc_params_toChinese, set_squares_ax

# 设置matplotlib参数
plt.style.use('_mpl-gallery')
plt.rcParams.update(rc_params_toChinese)
plt.subplots_adjust(left=0.15, bottom=0.1, right=0.9, top=0.9)

# 横坐标值
input_values = [i for i in range(1, 1001)]
# 平方值
squares = [i**2 for i in input_values]

ax = plt.subplot()
ax.scatter(input_values, squares, c=squares, cmap=plt.cm.Blues,s=10)

ax = set_squares_ax(ax)

ax.axis([0, 1100, 0, 1_100_000])
ax.ticklabel_format(style='plain')

# 查看绘图
plt.show()

# 保存绘图
plt.savefig('scatter_squares.png', bbox_inches='tight')